package com.tjbank.cssys.service.config.shiro.stateless.token;

import org.apache.shiro.authc.AuthenticationToken;

/**
 * Copyright © 天阳宏业科技股份有限公司 - All Rights Reserved
 *
 * @description: 无状态的Token与StatelessAuthcFilter配合使用.
 * @author: <a href="mailto:guzheng01@tansun.com.cn>Joey Gu</a>
 * @date: 2020-06-08 17:32
 **/
public class StatelessToken implements AuthenticationToken {

    /** ❤❤❤❤❤ */
    private static final long serialVersionUID = 1L;

    /**
     * 登录码.
     */
    private String loginCode;
    /**
     * token
     */
    private String token;

    public StatelessToken(String loginCode, String token) {
        this.loginCode = loginCode;
        this.token = token;
    }

    public String getLoginCode() {
        return loginCode;
    }

    public void setLoginCode(String loginCode) {
        this.loginCode = loginCode;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    @Override
    public Object getPrincipal() {
        return loginCode;
    }

    @Override
    public Object getCredentials() {
        return token;
    }
}
